#include"Sort.h"

void TestInsertSort()
{
    int a[] = { 3, 2, 6, 8, 4, 6, 0, 9, 5, 7, 1 };
    InsertSort(a, sizeof(a) / sizeof(int));
    PrintArray(a, sizeof(a) / sizeof(int));
}


void TestShellSort()
{
    int a[] = { 3, 2, 6, 8, 4, 6, 0, 9, 5, 7, 1 };
    ShellSort(a, sizeof(a) / sizeof(int));
    PrintArray(a, sizeof(a) / sizeof(int));
}


void TestSelectSort()
{
    int a[] = { 13, 2, 6, 8, 4, 6, 0, 9, 5, 7, 1 };
    SelectSort(a, sizeof(a) / sizeof(int));
    PrintArray(a, sizeof(a) / sizeof(int));
}


void TestHeapSort()
{
    int a[] = { 13, 2, 6, 8, 4, 6, 0, 9, 5, 7, 1 };
    HeapSort(a, sizeof(a) / sizeof(int));
    PrintArray(a, sizeof(a) / sizeof(int));
}


void TestBubbleSort()
{
    int a[] = { 3, 2, 6, 8, 4, 6, 0, 9, 5, 7, 1 };
    BubbleSort(a, sizeof(a) / sizeof(int));
    PrintArray(a, sizeof(a) / sizeof(int));
}


void TestQuickSort()
{
    int a[] = { 6,1,2,6,7,9,3,4,6,10,8 };
    QuickSort(a, 0, sizeof(a) / sizeof(int) - 1);
    PrintArray(a, sizeof(a) / sizeof(int));

    QuickSortNonR(a, 0, sizeof(a) / sizeof(int) - 1);
    PrintArray(a, sizeof(a) / sizeof(int));
}


void TestMergeSort()
{
    //int a[] = { 3, 2, 6, 8, 4, 6, 0, 9, 5, 7, 1 };
    //int a[] = {6,1,2,7,9,3,4,5,10,8};
    //int a[] = { 6,1,2,6,7,9,3,4,6,10,8 };
    int a[] = { 10,8,7,1,3,9,4,2,9,10,1,1,2,3 };
    /*PrintArray(a, sizeof(a) / sizeof(int));*/

    MergeSort(a, sizeof(a) / sizeof(int));
    PrintArray(a, sizeof(a) / sizeof(int));

    MergeSortNonR(a, sizeof(a) / sizeof(int));
    PrintArray(a, sizeof(a) / sizeof(int));
}


void TestCountSort()
{
    int a[] = { 1,3,9,1,5,1,2,3,-5,-5,-2 };
   /* PrintArray(a, sizeof(a) / sizeof(int));*/

    CountSort(a, sizeof(a) / sizeof(int));

    PrintArray(a, sizeof(a) / sizeof(int));
}

int main()
{
    //TestInsertSort();
    //TestShellSort();
    //TestSelectSort();
    //TestHeapSort();
    //TestBubbleSort();
    //TestQuickSort();
    //TestMergeSort();
    TestCountSort();
    return 0;
}